package com.bootdo.system.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
import org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean;

/**
 * @Desc
 * @date 2019/10/29
 *
 */
@Configuration
public class WebSocketConfig {

    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }

    @Bean
    public ServletServerContainerFactoryBean createServletServerContainerFactoryBean(){
        ServletServerContainerFactoryBean bean = new ServletServerContainerFactoryBean();
        bean.setMaxBinaryMessageBufferSize(10*1024);
        bean.setMaxTextMessageBufferSize(10*1024);
        return bean;
    }
}
